#!/usr/bin/perl

package CMUD::DBH;

use strict;
use warnings;
use DBI;

use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;

@ISA = qw(Exporter AutoLoader);
@EXPORT = qw( select_authentication );
$VERSION = '0.01';

sub select_authentication;

my $dbfile = 'ClaviusMUD.db';
my $data_path = '/ZhE/home/ZhE/documents/programming/perl/claviusmud/dat';

if ( not -e "$data_path/$dbfile" ) {
  &gen_database;
  print main::stderr "No database found by ClaviusMUD.DBH.pm - ", scalar localtime, "\n";
}

my $dbh = DBI->connect(
                       "dbi:SQLite:dbname=$data_path/$dbfile", "", "",
                       { 
                        RaiseError => 1, 
                        PrintError => 1,
                        AutoCommit => 0
                       },        
                      ) or die $DBI::errstr;
END {
  $dbh->commit;
  $dbh->disconnect;
}


1;
__END__
